<?php

function rsjy_t_get_browser(){
    if(strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 7.0") !== false){
        return "ie7";
    }elseif(strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 6.0") !== false){
        return "ie6";
    }elseif(strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 8.0") !== false){
        return "ie8";
    }elseif(strpos($_SERVER["HTTP_USER_AGENT"], "Gecko") !== false){
        return "gecko";
    } else {
        return "";
    }
}

function phptemplate_body_class($left, $right) {

    if ($left != '' && $right != '') {
        $class = 'sidebars';
    } else {
        if ($left != '') {
            $class = 'sidebar-left';
        }
        if ($right != '') {
            $class = 'sidebar-right';
        }
    }

    echo ' class="'. rsjy_t_get_browser() .' '. $class .'"';
}

function phptemplate_breadcrumb($breadcrumb) {
    if (!empty($breadcrumb)) {
        return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
    }
}
